#ifndef XMIWRITER_H
#define XMIWRITER_H

#include <QDomNode>
#include <QFile>

#include "io/writer/abstractwriter.h"
#include "uml/umldiritem.h"
#include "uml/class/umlclassitem.h"
#include "uml/projects/umlproject.h"
#include "uml/projects/umlclassdiagramm.h"
#include "uml/relations/umlrelation.h"

class XMIWriter : public AbstractWriter
{
public:
    XMIWriter();

    void setIsWMI(bool isWMI);

    void run();

protected:
    bool _isWMI;
    QDomDocument _doc;
    QMap<QString, UmlRelation*> _associations;
    QList<UmlRelation*> _realizations;

    QDomElement xmiRootTag();
    QDomElement documentationTag();
    QDomElement umlModelTag();
    void packagedElement(UmlGraphicsItem *item, QDomElement *parent);
    void ownedAttribute(UmlGraphicsItem *item, QDomElement *parent);
};

#endif // XMIWRITER_H
